# -*- coding: utf-8 -*-
# @Time    : 2023/5/8
# @Author  : tangyu
from app.main.entity.base_entity import BaseEntity


class PerformancePredirtionModelEntity(BaseEntity):
    """
    屈服强度各种参数
    """

    def __init__(self, request_data=None):
        request_data['Y'] = request_data['Y'].lower()
        request_data['time_type'] = request_data['time_type'].lower()
        request_data['group_var'] = request_data['group_var'].lower()
        request_data['upper_error'] = float(request_data['upperError'])
        request_data['lower_error'] = float(request_data['lowerError'])
        request_data['reelKey'] = request_data['reelKey'].lower()
        request_data['reelKey_cname'] = request_data['reelKey_cname'].lower()
        request_data['charNames'] = request_data['charNames'].lower()
        self.time_type = request_data['time_type']
        self.begin_data = request_data['begin_data']
        self.end_data = request_data['end_data']
        self.tablename = request_data['tablename']
        self.Y = request_data['Y']
        self.group_var = request_data['group_var']
        self.algorithm = request_data['algorithm']
        self.modelname = request_data['modelname']
        self.sql = request_data['sql']
        self.upper_error = float(request_data['upperError'])
        self.lower_error = float(request_data['lowerError'])
        self.reel_key = request_data['reelKey']
        self.sting_names = request_data['charNames'].replace(" ", "")
        self.reel_key_cname = request_data['reelKey_cname']
        if request_data:
            self.set_attr(request_data)

